<div class="in_content">
    <div class="cent_content">
        <div class="content_F01"></div>
        <div class="content">
            <?php if (!empty($productItem)) { ?>
                <div class="ProDetail">
                    <div class="cont_detail">
                        <div class="tt_Chome">
                            <p>
                            <?php if(isset($arr_rootPath) && !empty($arr_rootPath)){
                                foreach($arr_rootPath as $key=>$path_item){
                            ?>
                                <a  <?php echo $key==0?'class="tittop"':''?> href="<?php echo urlAlias($path_item->name_alias); ?>"><?php echo $path_item->name?> <?php if($key< count($arr_rootPath)-1) echo ">>"; ?>  </a> 
                               	<?php } ?>	
                            <?php } ?> 
                            </p>
                        </div><!--tt_Chome-->
                        <div class="cc_Chome">
                            <div class="DetailPro">
                                <div class="hinhsanpham">
                                    <div id="lofslidecontent45">
                                        <div class="lof-main-outer">
                                            <ul class="lof-main-wapper">
                                                <?php
                                                for ($i = 1; $i < 6; $i++) {
                                                    $name_img = 'image_' . $i;
                                                    $image_val = $productItem->$name_img;
                                                    if ($image_val != '') {
                                                        ?>	
                                                        <li>
                                                            <div class="wrap">
                                                                <a href="<?php echo base_url("uploads/products/medium/{$image_val}") ?>" class="cloud-zoom zoom1" title="<?php echo $productItem->name ?>">
                                                                    <div class="logo-15">
                                                                        <table cellspacing="0" cellpadding="0" width="100%">
                                                                            <tbody>
                                                                                <tr>
                                                                                    <td class="logo_15">
                                                                                        <img src="<?php echo base_url("uploads/products/medium/{$image_val}") ?>" alt="<?php echo $productItem->name ?>" />
                                                                                    </td>
                                                                                </tr>
                                                                            </tbody>
                                                                        </table>
                                                                    </div>
                                                                </a>
                                                            </div>
                                                        </li>
                                                    <?php } ?>
                                                <?php } ?>
                                            </ul>  	
                                        </div><!--End .lof-main-wapper-->
                                        <div class="lof-navigator-wapper">
                                            <div onclick="return false" class="lof-next"><a href="#"></a></div>
                                            <div onclick="return false" class="lof-previous"><a href="#"></a></div>
                                            <div class="lof-navigator-outer">
                                                <ul class="lof-navigator">
                                                    <?php
                                                    for ($i = 1; $i < 6; $i++) {
                                                        $name_img = 'image_' . $i;
                                                        $image_val = $productItem->$name_img;
                                                        if ($image_val != '') {
                                                    ?>
                                                            <li><img src="<?php echo base_url("uploads/products/avatar/{$image_val}") ?>" alt=""/></li>
                                                        <?php } ?>
                                                    <?php } ?>

                                                </ul>
                                            </div>
                                        </div><!--End .lof-navigator-wapper-->
                                    </div><!--End #lofslidecontent45-->
                                </div><!--hinhsanpham-->
                                <form name="product_cart" action="<?php echo base_url("cart/add_cart");?>">
                                    <div class="thongtinsp">
                                        <ul>
                                            <li class="ttsp-1">
                                                <p><?php echo $productItem->name ?></p>
                                            </li>
                                            <li class="ttsp-10">
                                               
                                                <?php if($productItem->sprice > 0){  ?>
                                                <span style=" text-decoration:line-through;"><?php echo number_format($productItem->price, 0, ",", "."); ?> ₫</span><span>&nbsp;-&nbsp;</span>
                                                <span ><?php echo number_format($productItem->sprice, 0, ",", "."); ?> ₫</span> 	
												<?php }else{ ?>
                                                <span><?php echo number_format($productItem->price, 0, ",", "."); ?> ₫</span> 	
                                                <?php } ?>
                                            </li>
                                            <li class="ttsp-11">
                                                <div class="tt_sanpham">
                                                   <?php echo $productItem->features ?> 	
                                                </div>	
                                            </li>
                                            <li class="ttsp-4">
                                                <div class="sel_out">
                                                    <?php
                                                        $allowOrder = 9;
                                                        if(($allowOrder > $productItem->soluong) && ($productItem->soluong>0) ) {
                                                            $allowOrder = $productItem->soluong;
                                                        }
                                                    ?>
                                                    <select name="quanlity" style=" float:left; margin-left:10px; margin-top:9px; width:232px; height:20px; color:#666; border:none; background:none;">
                                                        <?php for($i=1; $i<=$allowOrder; $i++) { ?>
                                                            <option value="<?php echo $i;?>"><?php echo $i;?></option>
                                                        <?php }?>
                                                    </select>	
                                                </div>
                                                <input type="hidden" name="product_id" value="<?php echo $productItem->products_id; ?>" />
                                                <input type="hidden" name="soluong" value="<?php echo $productItem->soluong; ?>" />
<!--                                                
                                                <div class="conhang">
                                                    <span><p>Chỉ còn <strong><span id="soluong"><?php echo $productItem->soluong; ?></span></strong> sản phẩm</p></span>
                                                </div> 
                                                -->
                                            </li>
                                            <li class="ttsp-12">
                                                
                                                <ul>
                                                <?php if($productItem->soluong > 0){ ?>
                                                    <li class="thanhtoan add_cart" data-url="<?php echo urlAlias("dat-hang"); ?>"><a href="javascript:void(0);"><img src="<?php echo base_url() ?>templates/images/thanhtoan.png" alt="" /></a></li>
                                                    <li class="themvaogio add_cart" data-url="<?php echo urlAlias("gio-hang"); ?>"><a href="javascript:void(0);"><span><img src="<?php echo base_url() ?>templates/images/themvaogio.png" alt="" /></span></a></li>
                                                    <?php }else{ ?>
                                                    	<li class="thanhtoan"><img src="<?php echo base_url() ?>templates/images/chay-hang.png" alt="" /></li>
                                                    <?php } ?>
                                                    
                                                </ul> 	
                                            </li>
                                           
                                        </ul>
                                    </div><!--thongtinsp-->
                                </form>
                                <div class="thongtincanbiet">
                                    <div class="container">
                                        <ul class="tabs">
                                            <li class="first"><a href="#tab1"><span>Chi tiết sản phẩm</span></a></li>
                                            <li><a href="#tab6"><span>Thông tin sản phẩm</span></a></li>
                                           
                                            <li><a href="#tab5"><span>Chia sẻ</span></a></li>
                                        </ul>
                                        <div class="tab_container">
                                            <div style="display: block;" id="tab1" class="tab_content">
                                                <div class="xanh">
                                                    <div class="chitietsanpham">
                                                        <?php echo $productItem->details ?>   
                                                    </div><!--chitietsanpham-->
                                                </div><!--End .xanh-->
                                            </div>
                                             <?php if ($productItem->features) { ?>
                                                <div style="display: block;" id="tab6" class="tab_content">
                                                    <div class="xanh">
                                                    <p>&nbsp;</p>
                                                        <?php echo $productItem->features ?>
                                                    </div><!--End .xanh-->
                                                </div>
                                                    <?php } ?>
                                            <div style="display: block;" id="tab5" class="tab_content">
                                                <div class="xanh">
                                                        <div id="fb-root"></div>
                                                        <script>(function(d, s, id) {
                                                          var js, fjs = d.getElementsByTagName(s)[0];
                                                          if (d.getElementById(id)) return;
                                                          js = d.createElement(s); js.id = id;
                                                          js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
                                                          fjs.parentNode.insertBefore(js, fjs);
                                                        }(document, 'script', 'facebook-jssdk'));</script>
                                                        <div class="fb-like" data-href="<?php echo urlAlias($productItem->name_alias."/item-{$productItem->products_id}");?>" data-send="true" data-width="950" data-show-faces="true" style="margin-top:5px; margin-left:5px;"></div>
                                                        <div class="fb-comments" data-href="<?php echo urlAlias($productItem->name_alias."/item-{$productItem->products_id}");?>" data-width="950" data-num-posts="3" data-height="700" style="margin-top:5px; margin-left:5px;"></div>
                                                   
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div><!--End .thongtincanbiet-->
                            </div><!--DetailPro-->
                        </div><!--cc_Chome-->
                    </div><!--cont_detail-->
                </div><!--ProDetail-->
                <?php } ?>
               
            <?php if (isset($otherProducts) && !empty($otherProducts)) { ?>
                <div class="boxSlider">
                    <span><p>Có thể bạn sẽ thích?</p></span>
                    <div class="boxCcSlider">
                        <div  class="ca-container">
                            <div class="ca-wrapper">
                                <?php foreach ($otherProducts as $item) { ?>
                                    <div class="ca-item">
                                        <div class="box_Chome box_CSlider">
                                            <ul>
                                                <li class="pic">
                                                    <?php if (!empty($item->salesOff)) { ?>
                                                        <div class="salesOff"><p><?php echo $item->salesOff; ?>%</p></div><!--salesOff-->
                                                <?php }#endif  ?>
                                                    <a href="<?php echo urlAlias($item->name_alias . "/item-{$item->products_id}"); ?>" title="<?php echo $item->name; ?>"><img src="<?php echo base_url("uploads/products/medium/{$item->image}"); ?>" alt="<?php echo $item->name; ?>" /></a>
                                                </li>
                                               
                                                <li class="tit"><a href="<?php echo urlAlias($item->name_alias . "/item-{$item->products_id}"); ?>" title="<?php echo $item->name; ?>"><?php echo $this->string_library->catchu(strip_tags($item->name),50);?></a></li>
                                                <li class="pri">
                                                    <ul>
                                                    <?php if($item->sprice > 0){  ?>
                                                        <li class="gt"><p><?php echo number_format($item->price, 0, ",", "."); ?></p><span>&nbsp;VNĐ&nbsp;-&nbsp;</span></li>
                                                        <li class="gb"><p><?php echo number_format($item->sprice, 0, ",", "."); ?></p><span>&nbsp;VNĐ</span></li>
                                                      <?php }else{ ?>
                                                       <li class="gb"><p><?php echo number_format($item->price, 0, ",", "."); ?></p><span>&nbsp;VNĐ</span></li>
                                                      <?php } ?>
                                                    </ul>
                                                </li>
                                                
                                            </ul>
                                        </div><!--box_Chome box_CSlider-->
                                    </div>
                                <?php } ?>

                            </div>
                        </div>
                    </div><!--boxCcSlider-->
                </div><!--boxSlider-->
            <?php } ?>
        </div><!--content-->
        <div class="content_L01"></div>
    </div><!--cent_content-->
</div>